The present invention relates to a communication device and method, where a data unit oriented communication between a sender and a receiver is performed, said sender and receiver operating in accordance with a predetermined communication protocol.
Data unit oriented communication is well-known. In data unit oriented communication an amount of data is divided into one or more data units, where the structure of the data units is defined by a communication protocol to which the sender and receiver in the communication adhere. The protocol also defines how specific information is to be coded, and how the sender and/or receiver may react to specific information. Data unit oriented communication is also known as packet exchange communication. It should be noted that the data units used in connection with specific protocols have different names, such as packets, frames, segments etc. For the purpose of the present description, the term “data unit” shall generically refer to all types of units used in a data unit oriented communication.
A feature that many communication protocols use for increasing reliability is that of acknowledging received data. More specifically, a sender or sending peer of the given protocol sends out data units, and the receiver or receiving peer of the given protocol acknowledges the correct receipt by returning appropriate acknowledgment data units. In this way, the sending peer is informed that the data units that were sent were also correctly received, and can accordingly adjust the flow control of the further data units to be sent. An example of a protocol that uses acknowledgment data units is the so-called transmission control protocol (TCP), which is a part of the TCP/IP protocol suite.
The transmission control protocol and the TCP/IP protocol suite are e.g. well described in “TCP/IP Illustrated, Volume 1—The Protocols” by W. Richard Stevens, Addison-Wesley, 1994.
In order to cope with the fact that data units or acknowledgment data units may be lost, a time-out feature is provided in many protocols. Such a time-out feature means that a time-out period is set when data is sent, and if the specific data has not been acknowledged by the time the time-out period expires, a time-out response procedure is started. In TCP, the time-out response consists in retransmitting the data that was not acknowledged, and resetting one or more flow control parameters.
As an example, TCP uses a window-based flow control. TCP is a byte oriented protocol that divides a given number of bytes to be sent into so-called segments, and a record of the sent data is kept in terms of bytes, i.e. up to which byte the data was sent, and a record of the received data is also kept in terms of bytes, i.e. up to which byte the data was received. The simplest way of controlling the flow of segments in connection with acknowledgment messages would be to send a segment and not send the next segment until the segment last sent was acknowledged. Such a method of flow control would however not be very efficient. As already mentioned, TCP uses window-based flow control, which is also referred to as flow control according to sliding windows his concept is also well described in the above mentioned book by W. Richard Stevens.
FIG. 2 illustrates the concept of sliding windows. As can be seen, an amount of 8.192 bytes is to be sent in the example, where this amount is divided into 8 segments. The sending of segments is controlled in accordance with the send window, where the left end of the send window is defined by the data in the segments that have been sent and already acknowledged. In the example of FIG. 2 this is the data up to 2.048 bytes, i.e. the segments 1 and 2. The adjustment of the length of the send window, and thereby the right end of the window is a matter of the control procedure, which need not be explained in detail here.
The send window defines the amount of data which may have its corresponding acknowledgment outstanding. In the example of FIG. 2, the data up to 4.096 bytes, i.e. segments 3 and 4 have been sent and not yet acknowledged, and the difference between such sent and not acknowledged segments and the right end of the send window defines the usable window, i.e. the data that may still be sent without having received any further acknowledgments. As a consequence, in the example of FIG. 2 segments 5 and 6 may still be sent, but segments 7 and 8 can only be sent if the window moves to the right, which happens if further segments are acknowledged such that the left end moves to the right and/or if the length of the send window increases.
Furthermore, it should be noted that TCP provides for cumulative acknowledgment, i.e. there is not a one-to-one correspondence between segments and acknowledgments for segments, because one acknowledgment message may cover a plurality of segments. As an example, the receiving peer for the data amount shown in FIG. 2 could send an acknowledgment of bytes up to 4.096, such that this acknowledgment message would cover both segments 3 and 4.
The send window used by the sending peer will typically be determined by the so-called offered or advertised window, which is a data length provided to the sending peer by the receiving peer. In this way, the receiving peer can influence how many segments the sending peer will send at a time, and typically the advertised window will be calculated on the basis of the receiving peer's receive buffer. Also, the advertised window is a dynamic parameter that may be changed with every acknowledgment sent by the receiving peer.
Beyond the advertised window, it is also known to define the so-called congestion window, which is used in connection with several congestion control routines such as slow start, congestion avoidance, fast retransmit and fast recovery, again see e.g. the above mentioned book by W. Richard Stevens. The congestion window is a record that the sending peer keeps, and it is intended to take into account the congestion along the connection between the sending peer and receiving peer. As a typical control mechanism, the send window will be defined as the smaller of the advertised window and congestion window.
While the advertised window is a flow control imposed by the receiving peer, the congestion window is a flow control imposed by the sending peer, as a mechanism for taking congestion into account.
In a general sense, the congestion window is an example of an adaptive flow control parameter. In TCP the above mentioned time-out response consists in resetting the congestion window to one segment and then consequently only sending one segment, namely retransmitting the segment that was not acknowledged and thereby caused the time-out. The sending peer then waits for the acknowledgment of said retransmitted segment.
Another example of an adaptive flow control parameter is the time out period itself, which e.g. in TCP is referred to as RTO (Retransmission Time Out). The RTO is doubled as a response to a time out.
As already mentioned, the time-out feature is a data loss detection mechanism. Other data loss detection mechanisms exist. Another example is the retransmission of data units in TCP in response to the receipt of duplicate acknowledgments. This mechanism will be briefly explained in the following.
As already mentioned (see e.g. FIG. 2), a data amount to be sent is divided into a sequence. Conventional implementations of TCP are arranged such that if the receiving peer has received and acknowledged a certain data amount up to a given byte (a certain number of consecutive segments), it expects the data that is next in the sequence. For example, if segments up to segment 4 have been received, then segment 4 is acknowledged and the receiving peer expects to receive segment 5. If it then receives a further data unit that is different from segment 5 (e.g. segments 6, 7 and 8), it continues to acknowledge segment 4 for each data unit it receives. As a consequence, the sending peer receives duplicate acknowledgments. Commonly, TCP is implemented in such a way that the sending peer will count the number of duplicate acknowledgments, and if a certain threshold value is reached (e.g. 3), then the data unit next in the sequence to the data unit for which duplicate acknowledgments were received is retransmitted.